1. Field of the Invention
The invention relates to an image processing method for classifying which of a plurality of image areas each pixel belongs to, such as a character area, a dot area, and an on-dot character area, a program for executing the method, a recording medium in which the program is recorded, an image processing apparatus, and an image forming apparatus having the same.
2. Description of the Related Art
Related-art image forming apparatus read the overall image of an original with an image sensor that uses a charge coupled device (abbreviated as a CCD) and performs various processing to improve the reproducibility of the original during the formation of the image. For improving the reproducibility of the original, it is determined which of a plurality of image areas an image area containing a plurality of pixels in the whole image belongs to, on the basis of an image signal representing the entire image of the original; thus, various image areas such as a character area, a dot area, and a photograph area are extracted on the basis of the result of determination.
As a method for classifying a plurality of image areas, there are image classification methods by pattern matching and by using a character parameter. In the method of pattern matching, the entire image is divided into local pixel blocks containing a plurality of pixels, which are compared with a predetermined plurality of patterns, and thus the individual local pixel block is classified.
Specific examples with the character parameter are image classification methods disclosed in Japanese Unexamined Patent Publication JP-A 62-147860 (1987), Japanese Examined Patent Publication JP-B2 6-66884 (1994), and Japanese Unexamined Patent Publication JP-A 6-178097 (1994).
The image classification method disclosed in JP-A 62-147860 employs a halftone facsimile system. In the halftone facsimile system, a plurality of local pixel blocks contained in the entire image is subjected to an image-area classification processing. For a plurality of pixels in each local pixel block, the maximum pixel value and the minimum pixel value are obtained and the difference between the maximum pixel value and the minimum pixel value is calculated. The value of the difference calculated in each local pixel block is compared with a preset value, respectively. When the difference value is lower than the preset value, the local pixel block is classified as an image area containing a photograph section in which the value of the pixel varies gradually as it moves in a predetermined scanning direction. When the difference value is higher than the preset value, the local pixel block is classified as an image area containing a character section, the outline of a photograph section, or a dot photograph section in which the value of the pixel changes drastically as it moves in a predetermined scanning direction. Furthermore, for each local pixel block, the respective numbers of changes in the values of adjacent two pixels as it moves in a predetermined scanning direction and a sub scanning direction. The numbers of changes and a preset value are compared, wherein when the numbers of changes are larger than the preset value, the local pixel block is determined as a dot area containing a dot section, and when the numbers of changes are smaller than the preset value, the local pixel block is determined as being not a dot area. The pixels in the local pixel blocks are subjected to various processing on the basis of the result of classification.
The image classification method disclosed in JP-B2 6-66884 employs a dot-photograph-area classification method. In the dot-photograph-area classification method, the image-area classification is given to each of a plurality of local pixel blocks contained in the entire image. For the set of adjacent two pixels in one local pixel block, the numbers of changes of the value of adjacent two pixels are obtained individually in the case where the values of the two pixels continue in the main scanning direction and in the case where the values of the two pixels continue in the sub scanning direction, and the sum total of the numbers of changes is obtained. The sum total of the numbers of changes obtained for each local pixel block is compared with the preset value, and thus, the image area is classified on the basis of the result of comparison.
In the dot extracting apparatus disclosed in JP-A 6-178097, the number of pixels between two horizontal poles in the main scanning direction and the number of pixels between two vertical poles in the sub scanning direction are counted, respectively, and the counts are used as characteristic parameters, and thus, dot pixels contained in a dot area are extracted. For the main scanning direction, while setting either one of the maximum point at which the concentration rises to a maximum and the minimum point at which the concentration is reduced to a minimum as a horizontal pole, with digital multilevel data as input, the number of pixels between the two horizontal poles is counted. Also for the sub scanning direction, while setting either one of the maximum point at which the concentration becomes maximum and the minimum point at which the concentration becomes minimum as a vertical pole, two vertical poles are determined and the number of pixels between the two vertical poles is counted. When the number of the pixels between the horizontal poles is within a predetermined range, only pixels in which the number of pixels between the vertical poles is within a predetermined range among the pixels between the horizontal poles are extracted as dot pixels.
The image classification method by pattern matching requires a lot of patterns, thus posing a problem in that the capacity of a memory for storing a plurality of patterns must be increased and the general versatility is low.
In the image classification method using the characteristic parameter, the values of the characteristic parameters are not conforming, that is, the values of the characteristic parameters do not represent the respective characteristics of the image areas; therefore, the respective image areas cannot be accurately classified, so that pixels that belong to a desired image area cannot be extracted. For the dot area, a dot section having a small number of lines has a characteristic similar to the character section. Accordingly, it is difficult to discriminate the dot section from the character section, so that the dot section cannot be accurately extracted. An on-dot character area, in which the substrate in the character area is formed of a plurality of dot pixels, is not classified as a character area but is classified as a dot area, so that it is subjected to an optimum process for the dot area, for example, smoothing filter processing for reducing moire. Accordingly, the reproducibility of the character area is significantly damaged, so that the reproducibility of the on-dot character area is also reduced to form a low-quality image. For the dot photograph area in which a photographic image is formed of a plurality of dot pixels, an inter-area edge that is the boundary between a figure and the back in a dot photograph having a large of lines and dot pixels having a small number of lines are determined erroneously as a character area. Therefore, the reproducibility of the dot photograph area is damaged significantly, thus producing a problem of generating the degradation of image quality during the formation of an image.